/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network;

import ru.qiwi.security.Security;
import lib.DOMNode;
import Core.Contants;
import Core.GlobalData;
import DTO.Client;

public class CreateXMLProvider {

	Object data;

	public CreateXMLProvider() {
	}

	public CreateXMLProvider(Object data) {
		this.data = data;
	}

	public String toXML() {
		DOMNode request = new DOMNode("request");

		// request.addNode(GlobalData.auth.toXML());
		request.addNode(GlobalData.client.toXML());

		DOMNode node = request.addNode("persons").addNode("setPublicKey");
		node.addNode("store-type", "4");
		node.addNode("pubkey", Security.getIns().getPublicKeyAsBase64());

		return Contants.HEADER_XML + request.toString();
	}
}
